import request from '@/utils/request'

/**
 *
 * @param {{
 *  uid: number
 *  status: DEFAULT_SWITCH_VALUE
 *  keyword: string
 * }} data
 * @returns
 */
export function appList(data) {
  return request({
    url: '/member.app',
    method: 'post',
    data
  })
}

/**
 * 分配接口
 * @param {{
 *  appkey: string
 *  uid: string
 *  api_role: string[]
 * }} data
 * @returns
 */
export function role(data) {
  return request({
    url: '/member.app/role',
    method: 'post',
    data
  })
}

/**
 * 应用的接口列表
 * @param {{
 *  appkey: string
 *  uid: string
 * }} data
 * @returns
 */
export function appApi(data) {
  return request({
    url: '/member.app/api',
    method: 'post',
    data
  })
}

/**
 * 设置价格
 * @param {{
 *  appkey: string
 *  uid: string
 *  api_price: {
 *    api_id: string
 *    price: string
 *    counting_unit: string
 *    surplus_num: string
 *  }[]
 * }} data
 * @returns
 */
export function setPrice(data) {
  return request({
    url: '/member.app/price',
    method: 'post',
    data
  })
}
